Linux下Apache安装及配置

Categories: Linux; Tagged with: ; @ August 5th, 2010 21:34

Apache yum安装, httpd.conf配置, Service操作
image

1. yum安装Apache, php, mysql:

# yum -y install httpd php mysql mysql-server php-mysql php-mcrypt php-mhash php-mbstring php-xml php-gd

2. httpd配置

# vi /etc/httpd/conf/httpd.conf

2.1 改变根目录:
修改L281 DocumentRoot "/usr/web" 并设置 <Directory "/usr/web">

2.2. 改变端口: "/Listen"搜索,  该端口为想要的值

2.3 增加Alias: (行号仅供参考, Shifit+Y直接复制的)

301 #Red5 Streams
302 Alias /streams "/root/ivs/IVS/webapps/InspriseVideo/streams"
303 <Directory "/root/ivs/IVS/webapps/InspriseVideo/streams">
304         Options FollowSymLinks ExecCGI
305         AllowOverride All
306         Order allow,deny
307         Allow from all
308 </Directory>

3. Service操作

3. 1 查看所有Service: # chkconfig –list 将打印服务列表.
同时可使用chkconfig –add/ del 增加或移除服务

3.2 查看具体Service的状态:
# service httpd 可查看服务接受的参数,
# service  httpd status 查看Apache服务状态

3.3 启动/关闭/重启 Httpd:
#service httpd start/stop/restart

4. 如果配置httpd并重启Service后, 仍有403错误, 可能此文可帮助解决:http://liguoliang.com/2010/08/1384/

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.